using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Resources;
using Ent.Voice;
using Ent.Web;
public partial class Controls_Search : System.Web.UI.UserControl
{
    private Settings _set;
    int _catId = -1;
    public int CatagoryId
    {
        get { return _catId; }
        set { _catId = value; }
    }
    int _entId = -1;
    public int EntityId
    {
        get { return _entId; }
        set { _entId = value; }
    }
    string _key = "";
    public string key
    {
        get { return _key; }
        set { _key = value; }
    }
    public Controls_Search()
    {
        this.PreRender += new EventHandler(Controls_Search_PreRender);
    }

    void Controls_Search_PreRender(object sender, EventArgs e)
    {
         lblSearchFor.Text = ResourceHelper.Get("LBL_SearchFor");
         lblCatagory.Text = ResourceHelper.Get("LBL_Catagory");
         lblSearch.Text = ResourceHelper.Get("LBL_Search");
         lblKeyword.Text = ResourceHelper.Get("LBL_Keyword");
         ddlCatagory.SelectedIndex = ddlCatagory.Items.IndexOf(ddlCatagory.Items.FindByValue(_catId.ToString()));
         ddlSearchFor.SelectedIndex = ddlSearchFor.Items.IndexOf(ddlSearchFor.Items.FindByValue(_entId.ToString()));
         txtKeyword.Text = _key;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            _set = new Settings(Server.MapPath("Data/Settings.xml"));
            ddlCatagory.Items.AddRange(_set.GetItemCollection("Catagory", new ListItem[] { new ListItem("All", "-1") }));
            //ddlSearchFor.Items.AddRange(_set.GetItemCollection("Entity", new ListItem[] { new ListItem("All", "-1") }));
            ddlSearchFor.Items.AddRange(_set.GetItemCollection("Entity"));
        }
    }
    protected void btnGo_Click(object sender, ImageClickEventArgs e)
    {
        
    }
}
